using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using System.Data;
using PCSUtils.Utils;
using PCSComUtils.PCSExc;
using PCSComUtils.Common;
using PCSComProduct.Items.BO;
using PCSComProduct.Items.DS;
using PCSUtils.Log;
using PCSComUtils.DataContext;

namespace PCSProduct.Items
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class Catalog : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button btnHelp;
		private System.Windows.Forms.Button btnClose;
		private System.Windows.Forms.Button btnDelete;
		private System.Windows.Forms.Button btnSave;
		private System.Windows.Forms.Button btnEdit;
		private System.Windows.Forms.Button btnAdd;
		private System.Windows.Forms.Label lblCategoryNameVN;
		private System.Windows.Forms.Label lblDesc;
		private System.Windows.Forms.Label lblCategoryName;
		private System.Windows.Forms.Label lblCategoryCode;
		private System.Windows.Forms.Label lblRootCaption;
		private System.ComponentModel.Container components = null;
		private System.Windows.Forms.TreeView tvwCategory;

		/// <summary>
		/// Required designer variable.
		/// </summary>		
		private const string THIS = "PCSProduct.Items.Catalog";
		private const string CHECKED = "Checked";
		private const string TRUE	= "True";
		private const string ROOT = "Root";
		
		private EnumAction enumAction = EnumAction.Default;
		private System.Windows.Forms.TextBox txtProductCode;
		private System.Windows.Forms.TextBox txtProdcutName;
		private System.Windows.Forms.TextBox txtCategoryNameVN;
		private System.Windows.Forms.TextBox txtDesc;
		private System.Windows.Forms.Label lblPicture;
		private System.Windows.Forms.PictureBox picCategory;
		private System.Windows.Forms.Button btnChangePicture;
		private System.Windows.Forms.OpenFileDialog dlgSelectPicture;
		private System.Windows.Forms.Button btnClearPicture;
		
		private bool blnHasError = false;
		
		public Catalog()
		{
			InitializeComponent();
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Catalog));
			this.btnHelp = new System.Windows.Forms.Button();
			this.btnClose = new System.Windows.Forms.Button();
			this.btnEdit = new System.Windows.Forms.Button();
			this.btnAdd = new System.Windows.Forms.Button();
			this.btnSave = new System.Windows.Forms.Button();
			this.btnDelete = new System.Windows.Forms.Button();
			this.lblDesc = new System.Windows.Forms.Label();
			this.lblCategoryName = new System.Windows.Forms.Label();
			this.lblCategoryCode = new System.Windows.Forms.Label();
			this.tvwCategory = new System.Windows.Forms.TreeView();
			this.lblRootCaption = new System.Windows.Forms.Label();
			this.lblCategoryNameVN = new System.Windows.Forms.Label();
			this.txtProductCode = new System.Windows.Forms.TextBox();
			this.txtProdcutName = new System.Windows.Forms.TextBox();
			this.txtCategoryNameVN = new System.Windows.Forms.TextBox();
			this.txtDesc = new System.Windows.Forms.TextBox();
			this.lblPicture = new System.Windows.Forms.Label();
			this.picCategory = new System.Windows.Forms.PictureBox();
			this.btnChangePicture = new System.Windows.Forms.Button();
			this.dlgSelectPicture = new System.Windows.Forms.OpenFileDialog();
			this.btnClearPicture = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// btnHelp
			// 
			this.btnHelp.AccessibleDescription = resources.GetString("btnHelp.AccessibleDescription");
			this.btnHelp.AccessibleName = resources.GetString("btnHelp.AccessibleName");
			this.btnHelp.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnHelp.Anchor")));
			this.btnHelp.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnHelp.BackgroundImage")));
			this.btnHelp.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnHelp.Dock")));
			this.btnHelp.Enabled = ((bool)(resources.GetObject("btnHelp.Enabled")));
			this.btnHelp.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnHelp.FlatStyle")));
			this.btnHelp.Font = ((System.Drawing.Font)(resources.GetObject("btnHelp.Font")));
			this.btnHelp.Image = ((System.Drawing.Image)(resources.GetObject("btnHelp.Image")));
			this.btnHelp.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnHelp.ImageAlign")));
			this.btnHelp.ImageIndex = ((int)(resources.GetObject("btnHelp.ImageIndex")));
			this.btnHelp.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnHelp.ImeMode")));
			this.btnHelp.Location = ((System.Drawing.Point)(resources.GetObject("btnHelp.Location")));
			this.btnHelp.Name = "btnHelp";
			this.btnHelp.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnHelp.RightToLeft")));
			this.btnHelp.Size = ((System.Drawing.Size)(resources.GetObject("btnHelp.Size")));
			this.btnHelp.TabIndex = ((int)(resources.GetObject("btnHelp.TabIndex")));
			this.btnHelp.Text = resources.GetString("btnHelp.Text");
			this.btnHelp.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnHelp.TextAlign")));
			this.btnHelp.Visible = ((bool)(resources.GetObject("btnHelp.Visible")));
			// 
			// btnClose
			// 
			this.btnClose.AccessibleDescription = resources.GetString("btnClose.AccessibleDescription");
			this.btnClose.AccessibleName = resources.GetString("btnClose.AccessibleName");
			this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnClose.Anchor")));
			this.btnClose.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnClose.BackgroundImage")));
			this.btnClose.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnClose.Dock")));
			this.btnClose.Enabled = ((bool)(resources.GetObject("btnClose.Enabled")));
			this.btnClose.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnClose.FlatStyle")));
			this.btnClose.Font = ((System.Drawing.Font)(resources.GetObject("btnClose.Font")));
			this.btnClose.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.Image")));
			this.btnClose.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnClose.ImageAlign")));
			this.btnClose.ImageIndex = ((int)(resources.GetObject("btnClose.ImageIndex")));
			this.btnClose.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnClose.ImeMode")));
			this.btnClose.Location = ((System.Drawing.Point)(resources.GetObject("btnClose.Location")));
			this.btnClose.Name = "btnClose";
			this.btnClose.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnClose.RightToLeft")));
			this.btnClose.Size = ((System.Drawing.Size)(resources.GetObject("btnClose.Size")));
			this.btnClose.TabIndex = ((int)(resources.GetObject("btnClose.TabIndex")));
			this.btnClose.Text = resources.GetString("btnClose.Text");
			this.btnClose.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnClose.TextAlign")));
			this.btnClose.Visible = ((bool)(resources.GetObject("btnClose.Visible")));
			this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
			// 
			// btnEdit
			// 
			this.btnEdit.AccessibleDescription = resources.GetString("btnEdit.AccessibleDescription");
			this.btnEdit.AccessibleName = resources.GetString("btnEdit.AccessibleName");
			this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnEdit.Anchor")));
			this.btnEdit.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnEdit.BackgroundImage")));
			this.btnEdit.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnEdit.Dock")));
			this.btnEdit.Enabled = ((bool)(resources.GetObject("btnEdit.Enabled")));
			this.btnEdit.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnEdit.FlatStyle")));
			this.btnEdit.Font = ((System.Drawing.Font)(resources.GetObject("btnEdit.Font")));
			this.btnEdit.Image = ((System.Drawing.Image)(resources.GetObject("btnEdit.Image")));
			this.btnEdit.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnEdit.ImageAlign")));
			this.btnEdit.ImageIndex = ((int)(resources.GetObject("btnEdit.ImageIndex")));
			this.btnEdit.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnEdit.ImeMode")));
			this.btnEdit.Location = ((System.Drawing.Point)(resources.GetObject("btnEdit.Location")));
			this.btnEdit.Name = "btnEdit";
			this.btnEdit.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnEdit.RightToLeft")));
			this.btnEdit.Size = ((System.Drawing.Size)(resources.GetObject("btnEdit.Size")));
			this.btnEdit.TabIndex = ((int)(resources.GetObject("btnEdit.TabIndex")));
			this.btnEdit.Text = resources.GetString("btnEdit.Text");
			this.btnEdit.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnEdit.TextAlign")));
			this.btnEdit.Visible = ((bool)(resources.GetObject("btnEdit.Visible")));
			this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
			// 
			// btnAdd
			// 
			this.btnAdd.AccessibleDescription = resources.GetString("btnAdd.AccessibleDescription");
			this.btnAdd.AccessibleName = resources.GetString("btnAdd.AccessibleName");
			this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnAdd.Anchor")));
			this.btnAdd.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnAdd.BackgroundImage")));
			this.btnAdd.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnAdd.Dock")));
			this.btnAdd.Enabled = ((bool)(resources.GetObject("btnAdd.Enabled")));
			this.btnAdd.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnAdd.FlatStyle")));
			this.btnAdd.Font = ((System.Drawing.Font)(resources.GetObject("btnAdd.Font")));
			this.btnAdd.Image = ((System.Drawing.Image)(resources.GetObject("btnAdd.Image")));
			this.btnAdd.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnAdd.ImageAlign")));
			this.btnAdd.ImageIndex = ((int)(resources.GetObject("btnAdd.ImageIndex")));
			this.btnAdd.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnAdd.ImeMode")));
			this.btnAdd.Location = ((System.Drawing.Point)(resources.GetObject("btnAdd.Location")));
			this.btnAdd.Name = "btnAdd";
			this.btnAdd.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnAdd.RightToLeft")));
			this.btnAdd.Size = ((System.Drawing.Size)(resources.GetObject("btnAdd.Size")));
			this.btnAdd.TabIndex = ((int)(resources.GetObject("btnAdd.TabIndex")));
			this.btnAdd.Text = resources.GetString("btnAdd.Text");
			this.btnAdd.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnAdd.TextAlign")));
			this.btnAdd.Visible = ((bool)(resources.GetObject("btnAdd.Visible")));
			this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
			// 
			// btnSave
			// 
			this.btnSave.AccessibleDescription = resources.GetString("btnSave.AccessibleDescription");
			this.btnSave.AccessibleName = resources.GetString("btnSave.AccessibleName");
			this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnSave.Anchor")));
			this.btnSave.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSave.BackgroundImage")));
			this.btnSave.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnSave.Dock")));
			this.btnSave.Enabled = ((bool)(resources.GetObject("btnSave.Enabled")));
			this.btnSave.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnSave.FlatStyle")));
			this.btnSave.Font = ((System.Drawing.Font)(resources.GetObject("btnSave.Font")));
			this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image")));
			this.btnSave.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSave.ImageAlign")));
			this.btnSave.ImageIndex = ((int)(resources.GetObject("btnSave.ImageIndex")));
			this.btnSave.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnSave.ImeMode")));
			this.btnSave.Location = ((System.Drawing.Point)(resources.GetObject("btnSave.Location")));
			this.btnSave.Name = "btnSave";
			this.btnSave.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnSave.RightToLeft")));
			this.btnSave.Size = ((System.Drawing.Size)(resources.GetObject("btnSave.Size")));
			this.btnSave.TabIndex = ((int)(resources.GetObject("btnSave.TabIndex")));
			this.btnSave.Text = resources.GetString("btnSave.Text");
			this.btnSave.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSave.TextAlign")));
			this.btnSave.Visible = ((bool)(resources.GetObject("btnSave.Visible")));
			this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
			// 
			// btnDelete
			// 
			this.btnDelete.AccessibleDescription = resources.GetString("btnDelete.AccessibleDescription");
			this.btnDelete.AccessibleName = resources.GetString("btnDelete.AccessibleName");
			this.btnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnDelete.Anchor")));
			this.btnDelete.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnDelete.BackgroundImage")));
			this.btnDelete.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnDelete.Dock")));
			this.btnDelete.Enabled = ((bool)(resources.GetObject("btnDelete.Enabled")));
			this.btnDelete.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnDelete.FlatStyle")));
			this.btnDelete.Font = ((System.Drawing.Font)(resources.GetObject("btnDelete.Font")));
			this.btnDelete.Image = ((System.Drawing.Image)(resources.GetObject("btnDelete.Image")));
			this.btnDelete.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnDelete.ImageAlign")));
			this.btnDelete.ImageIndex = ((int)(resources.GetObject("btnDelete.ImageIndex")));
			this.btnDelete.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnDelete.ImeMode")));
			this.btnDelete.Location = ((System.Drawing.Point)(resources.GetObject("btnDelete.Location")));
			this.btnDelete.Name = "btnDelete";
			this.btnDelete.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnDelete.RightToLeft")));
			this.btnDelete.Size = ((System.Drawing.Size)(resources.GetObject("btnDelete.Size")));
			this.btnDelete.TabIndex = ((int)(resources.GetObject("btnDelete.TabIndex")));
			this.btnDelete.Text = resources.GetString("btnDelete.Text");
			this.btnDelete.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnDelete.TextAlign")));
			this.btnDelete.Visible = ((bool)(resources.GetObject("btnDelete.Visible")));
			this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
			// 
			// lblDesc
			// 
			this.lblDesc.AccessibleDescription = resources.GetString("lblDesc.AccessibleDescription");
			this.lblDesc.AccessibleName = resources.GetString("lblDesc.AccessibleName");
			this.lblDesc.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblDesc.Anchor")));
			this.lblDesc.AutoSize = ((bool)(resources.GetObject("lblDesc.AutoSize")));
			this.lblDesc.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblDesc.Dock")));
			this.lblDesc.Enabled = ((bool)(resources.GetObject("lblDesc.Enabled")));
			this.lblDesc.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.lblDesc.Font = ((System.Drawing.Font)(resources.GetObject("lblDesc.Font")));
			this.lblDesc.Image = ((System.Drawing.Image)(resources.GetObject("lblDesc.Image")));
			this.lblDesc.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblDesc.ImageAlign")));
			this.lblDesc.ImageIndex = ((int)(resources.GetObject("lblDesc.ImageIndex")));
			this.lblDesc.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblDesc.ImeMode")));
			this.lblDesc.Location = ((System.Drawing.Point)(resources.GetObject("lblDesc.Location")));
			this.lblDesc.Name = "lblDesc";
			this.lblDesc.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblDesc.RightToLeft")));
			this.lblDesc.Size = ((System.Drawing.Size)(resources.GetObject("lblDesc.Size")));
			this.lblDesc.TabIndex = ((int)(resources.GetObject("lblDesc.TabIndex")));
			this.lblDesc.Text = resources.GetString("lblDesc.Text");
			this.lblDesc.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblDesc.TextAlign")));
			this.lblDesc.Visible = ((bool)(resources.GetObject("lblDesc.Visible")));
			// 
			// lblCategoryName
			// 
			this.lblCategoryName.AccessibleDescription = resources.GetString("lblCategoryName.AccessibleDescription");
			this.lblCategoryName.AccessibleName = resources.GetString("lblCategoryName.AccessibleName");
			this.lblCategoryName.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblCategoryName.Anchor")));
			this.lblCategoryName.AutoSize = ((bool)(resources.GetObject("lblCategoryName.AutoSize")));
			this.lblCategoryName.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblCategoryName.Dock")));
			this.lblCategoryName.Enabled = ((bool)(resources.GetObject("lblCategoryName.Enabled")));
			this.lblCategoryName.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.lblCategoryName.Font = ((System.Drawing.Font)(resources.GetObject("lblCategoryName.Font")));
			this.lblCategoryName.ForeColor = System.Drawing.Color.Maroon;
			this.lblCategoryName.Image = ((System.Drawing.Image)(resources.GetObject("lblCategoryName.Image")));
			this.lblCategoryName.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCategoryName.ImageAlign")));
			this.lblCategoryName.ImageIndex = ((int)(resources.GetObject("lblCategoryName.ImageIndex")));
			this.lblCategoryName.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblCategoryName.ImeMode")));
			this.lblCategoryName.Location = ((System.Drawing.Point)(resources.GetObject("lblCategoryName.Location")));
			this.lblCategoryName.Name = "lblCategoryName";
			this.lblCategoryName.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblCategoryName.RightToLeft")));
			this.lblCategoryName.Size = ((System.Drawing.Size)(resources.GetObject("lblCategoryName.Size")));
			this.lblCategoryName.TabIndex = ((int)(resources.GetObject("lblCategoryName.TabIndex")));
			this.lblCategoryName.Text = resources.GetString("lblCategoryName.Text");
			this.lblCategoryName.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCategoryName.TextAlign")));
			this.lblCategoryName.Visible = ((bool)(resources.GetObject("lblCategoryName.Visible")));
			// 
			// lblCategoryCode
			// 
			this.lblCategoryCode.AccessibleDescription = resources.GetString("lblCategoryCode.AccessibleDescription");
			this.lblCategoryCode.AccessibleName = resources.GetString("lblCategoryCode.AccessibleName");
			this.lblCategoryCode.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblCategoryCode.Anchor")));
			this.lblCategoryCode.AutoSize = ((bool)(resources.GetObject("lblCategoryCode.AutoSize")));
			this.lblCategoryCode.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblCategoryCode.Dock")));
			this.lblCategoryCode.Enabled = ((bool)(resources.GetObject("lblCategoryCode.Enabled")));
			this.lblCategoryCode.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.lblCategoryCode.Font = ((System.Drawing.Font)(resources.GetObject("lblCategoryCode.Font")));
			this.lblCategoryCode.ForeColor = System.Drawing.Color.Maroon;
			this.lblCategoryCode.Image = ((System.Drawing.Image)(resources.GetObject("lblCategoryCode.Image")));
			this.lblCategoryCode.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCategoryCode.ImageAlign")));
			this.lblCategoryCode.ImageIndex = ((int)(resources.GetObject("lblCategoryCode.ImageIndex")));
			this.lblCategoryCode.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblCategoryCode.ImeMode")));
			this.lblCategoryCode.Location = ((System.Drawing.Point)(resources.GetObject("lblCategoryCode.Location")));
			this.lblCategoryCode.Name = "lblCategoryCode";
			this.lblCategoryCode.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblCategoryCode.RightToLeft")));
			this.lblCategoryCode.Size = ((System.Drawing.Size)(resources.GetObject("lblCategoryCode.Size")));
			this.lblCategoryCode.TabIndex = ((int)(resources.GetObject("lblCategoryCode.TabIndex")));
			this.lblCategoryCode.Text = resources.GetString("lblCategoryCode.Text");
			this.lblCategoryCode.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCategoryCode.TextAlign")));
			this.lblCategoryCode.Visible = ((bool)(resources.GetObject("lblCategoryCode.Visible")));
			// 
			// tvwCategory
			// 
			this.tvwCategory.AccessibleDescription = resources.GetString("tvwCategory.AccessibleDescription");
			this.tvwCategory.AccessibleName = resources.GetString("tvwCategory.AccessibleName");
			this.tvwCategory.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("tvwCategory.Anchor")));
			this.tvwCategory.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tvwCategory.BackgroundImage")));
			this.tvwCategory.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("tvwCategory.Dock")));
			this.tvwCategory.Enabled = ((bool)(resources.GetObject("tvwCategory.Enabled")));
			this.tvwCategory.Font = ((System.Drawing.Font)(resources.GetObject("tvwCategory.Font")));
			this.tvwCategory.HideSelection = false;
			this.tvwCategory.ImageIndex = ((int)(resources.GetObject("tvwCategory.ImageIndex")));
			this.tvwCategory.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("tvwCategory.ImeMode")));
			this.tvwCategory.Indent = ((int)(resources.GetObject("tvwCategory.Indent")));
			this.tvwCategory.ItemHeight = ((int)(resources.GetObject("tvwCategory.ItemHeight")));
			this.tvwCategory.Location = ((System.Drawing.Point)(resources.GetObject("tvwCategory.Location")));
			this.tvwCategory.Name = "tvwCategory";
			this.tvwCategory.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("tvwCategory.RightToLeft")));
			this.tvwCategory.SelectedImageIndex = ((int)(resources.GetObject("tvwCategory.SelectedImageIndex")));
			this.tvwCategory.Size = ((System.Drawing.Size)(resources.GetObject("tvwCategory.Size")));
			this.tvwCategory.TabIndex = ((int)(resources.GetObject("tvwCategory.TabIndex")));
			this.tvwCategory.Text = resources.GetString("tvwCategory.Text");
			this.tvwCategory.Visible = ((bool)(resources.GetObject("tvwCategory.Visible")));
			this.tvwCategory.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvwCategory_AfterSelect);
			// 
			// lblRootCaption
			// 
			this.lblRootCaption.AccessibleDescription = resources.GetString("lblRootCaption.AccessibleDescription");
			this.lblRootCaption.AccessibleName = resources.GetString("lblRootCaption.AccessibleName");
			this.lblRootCaption.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblRootCaption.Anchor")));
			this.lblRootCaption.AutoSize = ((bool)(resources.GetObject("lblRootCaption.AutoSize")));
			this.lblRootCaption.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblRootCaption.Dock")));
			this.lblRootCaption.Enabled = ((bool)(resources.GetObject("lblRootCaption.Enabled")));
			this.lblRootCaption.Font = ((System.Drawing.Font)(resources.GetObject("lblRootCaption.Font")));
			this.lblRootCaption.Image = ((System.Drawing.Image)(resources.GetObject("lblRootCaption.Image")));
			this.lblRootCaption.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblRootCaption.ImageAlign")));
			this.lblRootCaption.ImageIndex = ((int)(resources.GetObject("lblRootCaption.ImageIndex")));
			this.lblRootCaption.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblRootCaption.ImeMode")));
			this.lblRootCaption.Location = ((System.Drawing.Point)(resources.GetObject("lblRootCaption.Location")));
			this.lblRootCaption.Name = "lblRootCaption";
			this.lblRootCaption.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblRootCaption.RightToLeft")));
			this.lblRootCaption.Size = ((System.Drawing.Size)(resources.GetObject("lblRootCaption.Size")));
			this.lblRootCaption.TabIndex = ((int)(resources.GetObject("lblRootCaption.TabIndex")));
			this.lblRootCaption.Text = resources.GetString("lblRootCaption.Text");
			this.lblRootCaption.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblRootCaption.TextAlign")));
			this.lblRootCaption.Visible = ((bool)(resources.GetObject("lblRootCaption.Visible")));
			// 
			// lblCategoryNameVN
			// 
			this.lblCategoryNameVN.AccessibleDescription = resources.GetString("lblCategoryNameVN.AccessibleDescription");
			this.lblCategoryNameVN.AccessibleName = resources.GetString("lblCategoryNameVN.AccessibleName");
			this.lblCategoryNameVN.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblCategoryNameVN.Anchor")));
			this.lblCategoryNameVN.AutoSize = ((bool)(resources.GetObject("lblCategoryNameVN.AutoSize")));
			this.lblCategoryNameVN.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblCategoryNameVN.Dock")));
			this.lblCategoryNameVN.Enabled = ((bool)(resources.GetObject("lblCategoryNameVN.Enabled")));
			this.lblCategoryNameVN.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.lblCategoryNameVN.Font = ((System.Drawing.Font)(resources.GetObject("lblCategoryNameVN.Font")));
			this.lblCategoryNameVN.ForeColor = System.Drawing.Color.Black;
			this.lblCategoryNameVN.Image = ((System.Drawing.Image)(resources.GetObject("lblCategoryNameVN.Image")));
			this.lblCategoryNameVN.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCategoryNameVN.ImageAlign")));
			this.lblCategoryNameVN.ImageIndex = ((int)(resources.GetObject("lblCategoryNameVN.ImageIndex")));
			this.lblCategoryNameVN.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblCategoryNameVN.ImeMode")));
			this.lblCategoryNameVN.Location = ((System.Drawing.Point)(resources.GetObject("lblCategoryNameVN.Location")));
			this.lblCategoryNameVN.Name = "lblCategoryNameVN";
			this.lblCategoryNameVN.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblCategoryNameVN.RightToLeft")));
			this.lblCategoryNameVN.Size = ((System.Drawing.Size)(resources.GetObject("lblCategoryNameVN.Size")));
			this.lblCategoryNameVN.TabIndex = ((int)(resources.GetObject("lblCategoryNameVN.TabIndex")));
			this.lblCategoryNameVN.Text = resources.GetString("lblCategoryNameVN.Text");
			this.lblCategoryNameVN.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCategoryNameVN.TextAlign")));
			this.lblCategoryNameVN.Visible = ((bool)(resources.GetObject("lblCategoryNameVN.Visible")));
			// 
			// txtProductCode
			// 
			this.txtProductCode.AccessibleDescription = resources.GetString("txtProductCode.AccessibleDescription");
			this.txtProductCode.AccessibleName = resources.GetString("txtProductCode.AccessibleName");
			this.txtProductCode.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtProductCode.Anchor")));
			this.txtProductCode.AutoSize = ((bool)(resources.GetObject("txtProductCode.AutoSize")));
			this.txtProductCode.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtProductCode.BackgroundImage")));
			this.txtProductCode.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtProductCode.Dock")));
			this.txtProductCode.Enabled = ((bool)(resources.GetObject("txtProductCode.Enabled")));
			this.txtProductCode.Font = ((System.Drawing.Font)(resources.GetObject("txtProductCode.Font")));
			this.txtProductCode.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtProductCode.ImeMode")));
			this.txtProductCode.Location = ((System.Drawing.Point)(resources.GetObject("txtProductCode.Location")));
			this.txtProductCode.MaxLength = ((int)(resources.GetObject("txtProductCode.MaxLength")));
			this.txtProductCode.Multiline = ((bool)(resources.GetObject("txtProductCode.Multiline")));
			this.txtProductCode.Name = "txtProductCode";
			this.txtProductCode.PasswordChar = ((char)(resources.GetObject("txtProductCode.PasswordChar")));
			this.txtProductCode.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtProductCode.RightToLeft")));
			this.txtProductCode.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtProductCode.ScrollBars")));
			this.txtProductCode.Size = ((System.Drawing.Size)(resources.GetObject("txtProductCode.Size")));
			this.txtProductCode.TabIndex = ((int)(resources.GetObject("txtProductCode.TabIndex")));
			this.txtProductCode.Text = resources.GetString("txtProductCode.Text");
			this.txtProductCode.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtProductCode.TextAlign")));
			this.txtProductCode.Visible = ((bool)(resources.GetObject("txtProductCode.Visible")));
			this.txtProductCode.WordWrap = ((bool)(resources.GetObject("txtProductCode.WordWrap")));
			// 
			// txtProdcutName
			// 
			this.txtProdcutName.AccessibleDescription = resources.GetString("txtProdcutName.AccessibleDescription");
			this.txtProdcutName.AccessibleName = resources.GetString("txtProdcutName.AccessibleName");
			this.txtProdcutName.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtProdcutName.Anchor")));
			this.txtProdcutName.AutoSize = ((bool)(resources.GetObject("txtProdcutName.AutoSize")));
			this.txtProdcutName.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtProdcutName.BackgroundImage")));
			this.txtProdcutName.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtProdcutName.Dock")));
			this.txtProdcutName.Enabled = ((bool)(resources.GetObject("txtProdcutName.Enabled")));
			this.txtProdcutName.Font = ((System.Drawing.Font)(resources.GetObject("txtProdcutName.Font")));
			this.txtProdcutName.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtProdcutName.ImeMode")));
			this.txtProdcutName.Location = ((System.Drawing.Point)(resources.GetObject("txtProdcutName.Location")));
			this.txtProdcutName.MaxLength = ((int)(resources.GetObject("txtProdcutName.MaxLength")));
			this.txtProdcutName.Multiline = ((bool)(resources.GetObject("txtProdcutName.Multiline")));
			this.txtProdcutName.Name = "txtProdcutName";
			this.txtProdcutName.PasswordChar = ((char)(resources.GetObject("txtProdcutName.PasswordChar")));
			this.txtProdcutName.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtProdcutName.RightToLeft")));
			this.txtProdcutName.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtProdcutName.ScrollBars")));
			this.txtProdcutName.Size = ((System.Drawing.Size)(resources.GetObject("txtProdcutName.Size")));
			this.txtProdcutName.TabIndex = ((int)(resources.GetObject("txtProdcutName.TabIndex")));
			this.txtProdcutName.Text = resources.GetString("txtProdcutName.Text");
			this.txtProdcutName.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtProdcutName.TextAlign")));
			this.txtProdcutName.Visible = ((bool)(resources.GetObject("txtProdcutName.Visible")));
			this.txtProdcutName.WordWrap = ((bool)(resources.GetObject("txtProdcutName.WordWrap")));
			// 
			// txtCategoryNameVN
			// 
			this.txtCategoryNameVN.AccessibleDescription = resources.GetString("txtCategoryNameVN.AccessibleDescription");
			this.txtCategoryNameVN.AccessibleName = resources.GetString("txtCategoryNameVN.AccessibleName");
			this.txtCategoryNameVN.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtCategoryNameVN.Anchor")));
			this.txtCategoryNameVN.AutoSize = ((bool)(resources.GetObject("txtCategoryNameVN.AutoSize")));
			this.txtCategoryNameVN.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtCategoryNameVN.BackgroundImage")));
			this.txtCategoryNameVN.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtCategoryNameVN.Dock")));
			this.txtCategoryNameVN.Enabled = ((bool)(resources.GetObject("txtCategoryNameVN.Enabled")));
			this.txtCategoryNameVN.Font = ((System.Drawing.Font)(resources.GetObject("txtCategoryNameVN.Font")));
			this.txtCategoryNameVN.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtCategoryNameVN.ImeMode")));
			this.txtCategoryNameVN.Location = ((System.Drawing.Point)(resources.GetObject("txtCategoryNameVN.Location")));
			this.txtCategoryNameVN.MaxLength = ((int)(resources.GetObject("txtCategoryNameVN.MaxLength")));
			this.txtCategoryNameVN.Multiline = ((bool)(resources.GetObject("txtCategoryNameVN.Multiline")));
			this.txtCategoryNameVN.Name = "txtCategoryNameVN";
			this.txtCategoryNameVN.PasswordChar = ((char)(resources.GetObject("txtCategoryNameVN.PasswordChar")));
			this.txtCategoryNameVN.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtCategoryNameVN.RightToLeft")));
			this.txtCategoryNameVN.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtCategoryNameVN.ScrollBars")));
			this.txtCategoryNameVN.Size = ((System.Drawing.Size)(resources.GetObject("txtCategoryNameVN.Size")));
			this.txtCategoryNameVN.TabIndex = ((int)(resources.GetObject("txtCategoryNameVN.TabIndex")));
			this.txtCategoryNameVN.Text = resources.GetString("txtCategoryNameVN.Text");
			this.txtCategoryNameVN.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtCategoryNameVN.TextAlign")));
			this.txtCategoryNameVN.Visible = ((bool)(resources.GetObject("txtCategoryNameVN.Visible")));
			this.txtCategoryNameVN.WordWrap = ((bool)(resources.GetObject("txtCategoryNameVN.WordWrap")));
			// 
			// txtDesc
			// 
			this.txtDesc.AccessibleDescription = resources.GetString("txtDesc.AccessibleDescription");
			this.txtDesc.AccessibleName = resources.GetString("txtDesc.AccessibleName");
			this.txtDesc.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtDesc.Anchor")));
			this.txtDesc.AutoSize = ((bool)(resources.GetObject("txtDesc.AutoSize")));
			this.txtDesc.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtDesc.BackgroundImage")));
			this.txtDesc.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtDesc.Dock")));
			this.txtDesc.Enabled = ((bool)(resources.GetObject("txtDesc.Enabled")));
			this.txtDesc.Font = ((System.Drawing.Font)(resources.GetObject("txtDesc.Font")));
			this.txtDesc.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtDesc.ImeMode")));
			this.txtDesc.Location = ((System.Drawing.Point)(resources.GetObject("txtDesc.Location")));
			this.txtDesc.MaxLength = ((int)(resources.GetObject("txtDesc.MaxLength")));
			this.txtDesc.Multiline = ((bool)(resources.GetObject("txtDesc.Multiline")));
			this.txtDesc.Name = "txtDesc";
			this.txtDesc.PasswordChar = ((char)(resources.GetObject("txtDesc.PasswordChar")));
			this.txtDesc.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtDesc.RightToLeft")));
			this.txtDesc.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtDesc.ScrollBars")));
			this.txtDesc.Size = ((System.Drawing.Size)(resources.GetObject("txtDesc.Size")));
			this.txtDesc.TabIndex = ((int)(resources.GetObject("txtDesc.TabIndex")));
			this.txtDesc.Text = resources.GetString("txtDesc.Text");
			this.txtDesc.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtDesc.TextAlign")));
			this.txtDesc.Visible = ((bool)(resources.GetObject("txtDesc.Visible")));
			this.txtDesc.WordWrap = ((bool)(resources.GetObject("txtDesc.WordWrap")));
			// 
			// lblPicture
			// 
			this.lblPicture.AccessibleDescription = resources.GetString("lblPicture.AccessibleDescription");
			this.lblPicture.AccessibleName = resources.GetString("lblPicture.AccessibleName");
			this.lblPicture.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblPicture.Anchor")));
			this.lblPicture.AutoSize = ((bool)(resources.GetObject("lblPicture.AutoSize")));
			this.lblPicture.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblPicture.Dock")));
			this.lblPicture.Enabled = ((bool)(resources.GetObject("lblPicture.Enabled")));
			this.lblPicture.Font = ((System.Drawing.Font)(resources.GetObject("lblPicture.Font")));
			this.lblPicture.Image = ((System.Drawing.Image)(resources.GetObject("lblPicture.Image")));
			this.lblPicture.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPicture.ImageAlign")));
			this.lblPicture.ImageIndex = ((int)(resources.GetObject("lblPicture.ImageIndex")));
			this.lblPicture.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblPicture.ImeMode")));
			this.lblPicture.Location = ((System.Drawing.Point)(resources.GetObject("lblPicture.Location")));
			this.lblPicture.Name = "lblPicture";
			this.lblPicture.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblPicture.RightToLeft")));
			this.lblPicture.Size = ((System.Drawing.Size)(resources.GetObject("lblPicture.Size")));
			this.lblPicture.TabIndex = ((int)(resources.GetObject("lblPicture.TabIndex")));
			this.lblPicture.Text = resources.GetString("lblPicture.Text");
			this.lblPicture.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPicture.TextAlign")));
			this.lblPicture.Visible = ((bool)(resources.GetObject("lblPicture.Visible")));
			// 
			// picCategory
			// 
			this.picCategory.AccessibleDescription = resources.GetString("picCategory.AccessibleDescription");
			this.picCategory.AccessibleName = resources.GetString("picCategory.AccessibleName");
			this.picCategory.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("picCategory.Anchor")));
			this.picCategory.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("picCategory.BackgroundImage")));
			this.picCategory.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.picCategory.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("picCategory.Dock")));
			this.picCategory.Enabled = ((bool)(resources.GetObject("picCategory.Enabled")));
			this.picCategory.Font = ((System.Drawing.Font)(resources.GetObject("picCategory.Font")));
			this.picCategory.Image = ((System.Drawing.Image)(resources.GetObject("picCategory.Image")));
			this.picCategory.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("picCategory.ImeMode")));
			this.picCategory.Location = ((System.Drawing.Point)(resources.GetObject("picCategory.Location")));
			this.picCategory.Name = "picCategory";
			this.picCategory.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("picCategory.RightToLeft")));
			this.picCategory.Size = ((System.Drawing.Size)(resources.GetObject("picCategory.Size")));
			this.picCategory.SizeMode = ((System.Windows.Forms.PictureBoxSizeMode)(resources.GetObject("picCategory.SizeMode")));
			this.picCategory.TabIndex = ((int)(resources.GetObject("picCategory.TabIndex")));
			this.picCategory.TabStop = false;
			this.picCategory.Text = resources.GetString("picCategory.Text");
			this.picCategory.Visible = ((bool)(resources.GetObject("picCategory.Visible")));
			// 
			// btnChangePicture
			// 
			this.btnChangePicture.AccessibleDescription = resources.GetString("btnChangePicture.AccessibleDescription");
			this.btnChangePicture.AccessibleName = resources.GetString("btnChangePicture.AccessibleName");
			this.btnChangePicture.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnChangePicture.Anchor")));
			this.btnChangePicture.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnChangePicture.BackgroundImage")));
			this.btnChangePicture.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnChangePicture.Dock")));
			this.btnChangePicture.Enabled = ((bool)(resources.GetObject("btnChangePicture.Enabled")));
			this.btnChangePicture.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnChangePicture.FlatStyle")));
			this.btnChangePicture.Font = ((System.Drawing.Font)(resources.GetObject("btnChangePicture.Font")));
			this.btnChangePicture.Image = ((System.Drawing.Image)(resources.GetObject("btnChangePicture.Image")));
			this.btnChangePicture.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnChangePicture.ImageAlign")));
			this.btnChangePicture.ImageIndex = ((int)(resources.GetObject("btnChangePicture.ImageIndex")));
			this.btnChangePicture.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnChangePicture.ImeMode")));
			this.btnChangePicture.Location = ((System.Drawing.Point)(resources.GetObject("btnChangePicture.Location")));
			this.btnChangePicture.Name = "btnChangePicture";
			this.btnChangePicture.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnChangePicture.RightToLeft")));
			this.btnChangePicture.Size = ((System.Drawing.Size)(resources.GetObject("btnChangePicture.Size")));
			this.btnChangePicture.TabIndex = ((int)(resources.GetObject("btnChangePicture.TabIndex")));
			this.btnChangePicture.Text = resources.GetString("btnChangePicture.Text");
			this.btnChangePicture.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnChangePicture.TextAlign")));
			this.btnChangePicture.Visible = ((bool)(resources.GetObject("btnChangePicture.Visible")));
			this.btnChangePicture.Click += new System.EventHandler(this.btnChangePicture_Click);
			// 
			// dlgSelectPicture
			// 
			this.dlgSelectPicture.Filter = resources.GetString("dlgSelectPicture.Filter");
			this.dlgSelectPicture.RestoreDirectory = true;
			this.dlgSelectPicture.Title = resources.GetString("dlgSelectPicture.Title");
			// 
			// btnClearPicture
			// 
			this.btnClearPicture.AccessibleDescription = resources.GetString("btnClearPicture.AccessibleDescription");
			this.btnClearPicture.AccessibleName = resources.GetString("btnClearPicture.AccessibleName");
			this.btnClearPicture.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnClearPicture.Anchor")));
			this.btnClearPicture.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnClearPicture.BackgroundImage")));
			this.btnClearPicture.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnClearPicture.Dock")));
			this.btnClearPicture.Enabled = ((bool)(resources.GetObject("btnClearPicture.Enabled")));
			this.btnClearPicture.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnClearPicture.FlatStyle")));
			this.btnClearPicture.Font = ((System.Drawing.Font)(resources.GetObject("btnClearPicture.Font")));
			this.btnClearPicture.Image = ((System.Drawing.Image)(resources.GetObject("btnClearPicture.Image")));
			this.btnClearPicture.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnClearPicture.ImageAlign")));
			this.btnClearPicture.ImageIndex = ((int)(resources.GetObject("btnClearPicture.ImageIndex")));
			this.btnClearPicture.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnClearPicture.ImeMode")));
			this.btnClearPicture.Location = ((System.Drawing.Point)(resources.GetObject("btnClearPicture.Location")));
			this.btnClearPicture.Name = "btnClearPicture";
			this.btnClearPicture.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnClearPicture.RightToLeft")));
			this.btnClearPicture.Size = ((System.Drawing.Size)(resources.GetObject("btnClearPicture.Size")));
			this.btnClearPicture.TabIndex = ((int)(resources.GetObject("btnClearPicture.TabIndex")));
			this.btnClearPicture.Text = resources.GetString("btnClearPicture.Text");
			this.btnClearPicture.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnClearPicture.TextAlign")));
			this.btnClearPicture.Visible = ((bool)(resources.GetObject("btnClearPicture.Visible")));
			this.btnClearPicture.Click += new System.EventHandler(this.btnClearPicture_Click);
			// 
			// Catalog
			// 
			this.AccessibleDescription = resources.GetString("$this.AccessibleDescription");
			this.AccessibleName = resources.GetString("$this.AccessibleName");
			this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
			this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
			this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin")));
			this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
			this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
			this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
			this.Controls.Add(this.btnClearPicture);
			this.Controls.Add(this.btnChangePicture);
			this.Controls.Add(this.picCategory);
			this.Controls.Add(this.lblPicture);
			this.Controls.Add(this.txtDesc);
			this.Controls.Add(this.txtCategoryNameVN);
			this.Controls.Add(this.txtProdcutName);
			this.Controls.Add(this.txtProductCode);
			this.Controls.Add(this.lblCategoryNameVN);
			this.Controls.Add(this.lblRootCaption);
			this.Controls.Add(this.tvwCategory);
			this.Controls.Add(this.lblDesc);
			this.Controls.Add(this.lblCategoryName);
			this.Controls.Add(this.lblCategoryCode);
			this.Controls.Add(this.btnHelp);
			this.Controls.Add(this.btnClose);
			this.Controls.Add(this.btnEdit);
			this.Controls.Add(this.btnAdd);
			this.Controls.Add(this.btnSave);
			this.Controls.Add(this.btnDelete);
			this.DockPadding.All = 2;
			this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
			this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
			this.KeyPreview = true;
			this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
			this.MaximizeBox = false;
			this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
			this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize")));
			this.Name = "Catalog";
			this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
			this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
			this.Text = resources.GetString("$this.Text");
			this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Catalog_KeyDown);
			this.Closing += new System.ComponentModel.CancelEventHandler(this.Catalog_Closing);
			this.Load += new System.EventHandler(this.Catalog_Load);
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		//-------------------
		private void Catalog_Load(object sender, System.EventArgs e)
		{
			string METHOD_NAME = THIS + ".Catalog_Load()";
			try
			{
				//Set authorization for user
				Security objSecurity = new Security();
				this.Name = THIS;
				if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
				{
					this.Close();
					return;
				}

				//Load form
				LoadTree();
				ResetForm();
				ControlState(false);
				btnEdit.Enabled = false;
				tvwCategory.Focus();
				tvwCategory.SelectedNode = tvwCategory.Nodes[0];
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}

		//**************************************************************************              
		///    <Description>
		///		Reset all control
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Monday, Mar 14, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void ResetForm()
		{
			txtProductCode.Text = string.Empty;
			txtProdcutName.Text = string.Empty;
			txtCategoryNameVN.Text = string.Empty;
			txtDesc.Text = string.Empty;
			picCategory.Image = null;
			txtProductCode.Focus();
		}

		//**************************************************************************              
		///    <Description>
		///     Enabale and Disbale control if form changed the state
		///    </Description>
		///    <Inputs>
		///		pblnState : bool
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Monday, Mar 14, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void ControlState(bool pblnState)
		{
			switch(enumAction)
			{
				case EnumAction.Default:
					txtProductCode.Enabled = false;
					txtProdcutName.Enabled = false;
					txtDesc.Enabled = false;
					txtCategoryNameVN.Enabled = false;
					btnClearPicture.Enabled = false;
					btnChangePicture.Enabled = false;
					btnAdd.Enabled = true;
					btnDelete.Enabled = false;
					btnEdit.Enabled = false;
					btnSave.Enabled = false;
					break;
				default:
					txtProductCode.Enabled = true && (enumAction == EnumAction.Add);
					txtProdcutName.Enabled = true;
					txtDesc.Enabled = true;
					txtCategoryNameVN.Enabled = true;
					btnClearPicture.Enabled = true;
					btnChangePicture.Enabled = true;
					btnSave.Enabled = true;
					btnAdd.Enabled = false;
					btnDelete.Enabled = false;
					btnEdit.Enabled = false;
					break;			
			}
		}

		//**************************************************************************              
		///    <Description>
		///		Get data from tree node to bind in the form
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Monday, Mar 14, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void BindDataFromNodeToForm(TreeNode pSelectNode)
		{
			ResetForm();
			ControlState(false);

			ITM_Category voCategory =(ITM_Category) pSelectNode.Tag;
			txtProductCode.Text = voCategory.Code;
			txtProdcutName.Text = voCategory.Name;
			txtDesc.Text = voCategory.Description;
			txtCategoryNameVN.Text = voCategory.CatalogName;
			//picCategory.Image = (Image)voCategory.Picture;
		}

		//**************************************************************************              
		///    <Description>
		///		Get data from form into the category object
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       ITM_CategoryVO
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Monday, Mar 14, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private ITM_Category GetDataFromFormToObj()
		{
			ITM_Category voCategory = new ITM_Category();
			voCategory.Code = txtProductCode.Text.ToString();
			voCategory.Name = txtProdcutName.Text.ToString();
			voCategory.CatalogName = txtCategoryNameVN.Text.ToString();
            //voCategory.Description = txtDesc.Text.ToString();
            //if (picCategory.Image != null)
            //    //voCategory.Picture = new BinaryReader().(picCategory.Image);
            //else
            //    voCategory.Picture = null;
			return voCategory;
		}

		//**************************************************************************              
		///    <Description>
		///       Load Category tree
		///    </Description>
		///    <Inputs>
		///       ptvwTreeView   
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Thursday, January 20, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void LoadTree()
		{
			ITM_CategoryBO boCategory = new ITM_CategoryBO();

			DataSet dsTree = boCategory.List();
			dsTree.Tables[ITM_CategoryTable.TABLE_NAME].Columns.Add(CHECKED, typeof(bool));

			TreeNode rootNode = new TreeNode();
			rootNode.Text = lblRootCaption.Text;
			rootNode.Tag = ROOT;

			tvwCategory.Nodes.Add(rootNode);

			foreach (DataRow dr in dsTree.Tables[ITM_CategoryTable.TABLE_NAME].Rows)
			{
				if ((dr[CHECKED].ToString().Trim() != TRUE) && (dr[ITM_CategoryTable.PARENTCATEGORYID_FLD] == DBNull.Value))
				{
					TreeNode node = NewNode(dr);
					rootNode.Nodes.Add(node);
					dr[CHECKED] = true;
					BuildTree(dsTree, node);
				}
			}
		}

		//**************************************************************************              
		///    <Description>
		///       This method uses to build root node
		///    </Description>
		///    <Inputs>
		///        dsTree : contains list of Category
		///        TreeNode : current node
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Thursday , January 20, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void BuildTree(DataSet dsTree, TreeNode node)
		{
			foreach (DataRow drNode in dsTree.Tables[0].Rows)
			{
				if (drNode[CHECKED].ToString().Trim() != TRUE)
				{
					string sqlSelect = ITM_CategoryTable.PARENTCATEGORYID_FLD + " = " + ((ITM_Category) node.Tag).CategoryID;
					DataRow[] drChildren = dsTree.Tables[ITM_CategoryTable.TABLE_NAME].Select(sqlSelect);
					foreach (DataRow drChild in drChildren)
					{
						if (drChild[CHECKED].ToString().Trim() != TRUE)
						{
							TreeNode childNode = new TreeNode();
							childNode = NewNode(drChild);
							node.Nodes.Add(childNode);
							drChild[CHECKED] = true;
							BuildTree(dsTree, childNode);
						}
					}
				}
			}
		}

		//**************************************************************************              
		///    <Description>
		///       Create a new node for tree
		///    </Description>
		///    <Inputs>
		///        DataRow contains all informations of Category      
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       TreeNode
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Thursday, January 20, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private TreeNode NewNode(DataRow row)
		{
			ITM_Category voCategory = new ITM_Category();
			voCategory.CategoryID = int.Parse(row[ITM_CategoryTable.CATEGORYID_FLD].ToString());
			voCategory.Code = row[ITM_CategoryTable.CODE_FLD].ToString();
			voCategory.Name = row[ITM_CategoryTable.NAME_FLD].ToString();
			voCategory.CatalogName = row[ITM_CategoryTable.CATALOGNAME_FLD].ToString();
			voCategory.Description = row[ITM_CategoryTable.DESCRIPTION_FLD].ToString();

			try
			{
				voCategory.ParentCategoryId = int.Parse(row[ITM_CategoryTable.PARENTCATEGORYID_FLD].ToString());
			}
			catch
			{
			}

			TreeNode node = new TreeNode();
			node.Tag = voCategory;
			node.Text= voCategory.Name;

			return node;
		}

		//**************************************************************************              
		///    <Description>
		///		Validate data on the form
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Monday, Mar 14, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private bool ValidateData()
		{
			if (FormControlComponents.CheckMandatory(txtProductCode))
			{
				PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK);
				txtProductCode.Focus();
				return false;
			}

			if (FormControlComponents.CheckMandatory(txtProdcutName))
			{
				PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK);
				txtProdcutName.Focus();
				return false;
			}
			return true;
		}

		//**************************************************************************              
		///    <Description>
		///			Process when users click the node in the tree
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Monday, Mar 14, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void tvwCategory_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
		{
			if (tvwCategory.SelectedNode.Tag.ToString().Trim() != ROOT)
			{
				BindDataFromNodeToForm(tvwCategory.SelectedNode);
				enumAction = EnumAction.Default;
				ControlState(false);
//				ExtendedProButton extendPro = (ExtendedProButton) btnDelete.Tag;
//				if (!extendPro.IsDisable)
//				{
					btnDelete.Enabled = true;
//				}
//				extendPro = (ExtendedProButton) btnEdit.Tag;
//				if (!extendPro.IsDisable)
//				{
					btnEdit.Enabled = true;
//				}
			}
			else
			{
				ResetForm();
				ControlState(false);
				btnDelete.Enabled = false;
			}
		}

		//**************************************************************************              
		///    <Description>
		///		  Add event, reset form and change form's state
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Monday, Mar 14, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void btnAdd_Click(object sender, System.EventArgs e)
		{
			enumAction = EnumAction.Add;
			ControlState(false);
			ResetForm();
		}

		//**************************************************************************              
		///    <Description>
		///		Save event, validate data
		///			check bussiness and insert into database
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Monday, Mar 14, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void btnSave_Click(object sender, System.EventArgs e)
		{
			blnHasError = false;
			if (enumAction != EnumAction.Default)
			{
				string METHOD_NAME = THIS + "btnSave_Click()";
				if (ValidateData())
				{
					ITM_CategoryBO boCategory = new ITM_CategoryBO();
					ITM_Category voCategory = new ITM_Category();
					try
					{
						voCategory = GetDataFromFormToObj();
						if (enumAction == EnumAction.Edit)
						{
							voCategory.CategoryID =((ITM_Category) (tvwCategory.SelectedNode.Tag)).CategoryID;
							boCategory.Update(voCategory);
						}
						if (enumAction == EnumAction.Add)
						{
							if (tvwCategory.SelectedNode.Tag.ToString().Trim() == ROOT)
							{
                                boCategory.Add(voCategory);
							}
							else
							{
								if ( tvwCategory.SelectedNode.Tag.ToString()!= ROOT )
								{
									if (!boCategory.CheckAddNewCategory(((ITM_Category) tvwCategory.SelectedNode.Tag).CategoryID))
									{
										voCategory.ParentCategoryId = ((ITM_Category) tvwCategory.SelectedNode.Tag).CategoryID;
										boCategory.Add(voCategory);
									}
									else
									{
										PCSMessageBox.Show(ErrorCode.MESSAGE_CATEGORY_NOADDCHILD, MessageBoxIcon.Error);
										return;
									}
								}
							}
						}
						PCSMessageBox.Show(ErrorCode.MESSAGE_AFTER_SAVE_DATA);
						txtCategoryNameVN.Enabled = false;
						txtDesc.Enabled = false;
						txtProdcutName.Enabled = false;
						UpdateNodeIntoTree();
						enumAction = EnumAction.Default;
						ControlState(false);
						if (tvwCategory.SelectedNode.Tag.ToString().Trim() != ROOT)
						{
							btnEdit.Enabled = true;
							btnDelete.Enabled = true;
							btnSave.Enabled = false;
							btnAdd.Enabled = true;
						}
						else
						{
							btnEdit.Enabled = false;
							btnDelete.Enabled = false;
							btnSave.Enabled = false;
							btnAdd.Enabled = true;
						}
						blnHasError = true;
						btnAdd.Focus();
					}
					catch (PCSException ex)
					{
						PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
						try
						{
							Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
						}
						catch
						{
							PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
						}
						if (ex.mCode == ErrorCode.DUPLICATE_KEY)
						{
							txtProductCode.Focus();
						}
					}
					catch (Exception ex)
					{
						PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
						try
						{
							Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
						}
						catch
						{
							PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
						}
					}
				}
			}
		}

		//**************************************************************************              
		///    <Description>
		///		Update node if users click save button
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Monday, Mar 14, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void UpdateNodeIntoTree()
		{
			ITM_CategoryBO boCategory = new ITM_CategoryBO();
			//edit node
			if (enumAction == EnumAction.Edit)
			{
				TreeNode newNode = tvwCategory.SelectedNode;
				newNode.Text = txtProdcutName.Text.ToString();
                newNode.Tag = boCategory.GetCategoryByCode(txtProductCode.Text.Trim());
			}
			//create new node
			if (enumAction == EnumAction.Add)
			{
				TreeNode newNode = new TreeNode();
				newNode.Text = txtProdcutName.Text.ToString();
                newNode.Tag = boCategory.GetCategoryByCode(txtProductCode.Text.Trim());
				tvwCategory.SelectedNode.Nodes.Add(newNode);
			}
		}

		//**************************************************************************              
		///    <Description>
		///		Edit vent, change form's staet and fill data on the controls to edit
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Monday, Mar 14, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void btnEdit_Click(object sender, System.EventArgs e)
		{
			if (tvwCategory.SelectedNode.Tag.ToString().ToString().Trim()!= ROOT)
			{
				enumAction = EnumAction.Edit;
				BindDataFromNodeToForm(tvwCategory.SelectedNode);
				ControlState(true);
				txtProductCode.Enabled = false;
				txtDesc.Enabled = true;
				txtProdcutName.Focus();
			}
		}

		//**************************************************************************              
		///    <Description>
		///		Delete event, check child of node and delete it if can
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Monday, Mar 14, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void btnDelete_Click(object sender, System.EventArgs e)
		{
			string METHOD_NAME = THIS + "btnDelete_Click";
			if (tvwCategory.SelectedNode.Tag.ToString()==ROOT)
			{
				return;
			}
			if (PCSMessageBox.Show(ErrorCode.MESSAGE_DELETE_RECORD, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
			{
				
				try
				{
					ITM_CategoryBO boCategory = new ITM_CategoryBO();
					boCategory.CheckAndDelete(((ITM_Category)tvwCategory.SelectedNode.Tag).CategoryID);
					tvwCategory.SelectedNode.Remove();
				}
				catch (PCSException ex)
				{
					PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
					try
					{
						Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
					}
					catch
					{
						PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
					}
				}
				catch (Exception ex)
				{
					PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
					try
					{
						Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
					}
					catch
					{
						PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
					}
				}
			}
		}

		//**************************************************************************              
		///    <Description>
		///		Close form event
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Monday, Mar 14, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void btnClose_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		//**************************************************************************              
		///    <Description>
		///		 Close form, check form's state and question if has change
		///    </Description>
		///    <Inputs>
		///    </Inputs>
		///    <Outputs>
		///    </Outputs>
		///    <Returns>
		///       void
		///    </Returns>
		///    <Authors>
		///       TuanDm
		///    </Authors>
		///    <History>
		///       Monday, Mar 14, 2005
		///    </History>
		///    <Notes>
		///    </Notes>
		//**************************************************************************
		private void Catalog_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{
			if ((enumAction == EnumAction.Add)||(enumAction == EnumAction.Edit))
			{
				DialogResult confirmDialog = PCSMessageBox.Show(ErrorCode.MESSAGE_QUESTION_STORE_INTO_DATABASE, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
				switch (confirmDialog)
				{
					case DialogResult.Yes:
						//Save before exit
						btnSave_Click(btnSave, new EventArgs());
						if (!blnHasError)
						{
							e.Cancel = true;
						}
						break;
					case DialogResult.No:
						break;
					case DialogResult.Cancel:
						e.Cancel = true;
						break;
				}
			}
		}

		private void Catalog_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Escape)
			{
				this.Close();
			}
		}

		private void btnChangePicture_Click(object sender, System.EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnChangePicture_Click()";
			try
			{
				if (System.Windows.Forms.DialogResult.Cancel == dlgSelectPicture.ShowDialog())
					return;
				Image img = Image.FromFile(dlgSelectPicture.FileName);
				if (img.Size.Width > picCategory.Size.Width ||
					img.Size.Height > picCategory.Size.Height)
					picCategory.SizeMode = PictureBoxSizeMode.StretchImage;
				else
					picCategory.SizeMode = PictureBoxSizeMode.CenterImage;
				picCategory.Image = Image.FromFile(dlgSelectPicture.FileName);
				picCategory.Image = Image.FromFile(dlgSelectPicture.FileName);
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
				}
			}
		}

		private void btnClearPicture_Click(object sender, System.EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnClearPicture_Click()";
			try
			{
				picCategory.Image = null;
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
				}
			}
		}
	}
}
